package com.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.test.annotation.Rollback;
import org.springframework.transaction.annotation.Transactional;

import com.entity.Article;

public interface ArticleMapper {
	List<Article> listRecentArticle(Integer n); //查询n个文章

	Article getArticleById(Integer id);//根据id查询文章信息

	List<Article> findAll(); //查询所有文章

	void addArticle(Article article); //添加文章

	void addArticleCategory(@Param("articleId") Integer articleId,@Param("categoryId") Integer categoryId); //添加文章和分类的关联

	void addArticleTag(@Param("articleId") Integer articleId,@Param("tagId") Integer tagId); //添加文章和标签的关联

	void deleteArticle(@Param("id") Integer id);//根据id删除文章
	void deleteCategoryref(@Param("id") Integer id);//根据id删除分类关联
	void deleteTagref(@Param("id") Integer id);//根据id删除标签关联

	void UpdateArticle(Article article); //更新文章

	void UPdateCategory(@Param("articleId") Integer articleId,@Param("categoryId") Integer categoryId);//更新分类关联表

	void UPdateTag(@Param("articleId") Integer articleId,@Param("tagId") Integer tagId); //更新标签关联表

	

	
}






















